load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

package(default_visibility = [
    "//rs/crypto:__subpackages__",
    "//rs/http_endpoints:__subpackages__",
    "//rs/orchestrator:__subpackages__",
    "//rs/p2p:__subpackages__",
    "//rs/replica:__subpackages__",
    "//rs/replica/setup_ic_network:__subpackages__",
    "//rs/test_utilities:__subpackages__",
    "//rs/xnet/endpoint:__subpackages__",
    "//rs/xnet/hyper:__subpackages__",
    "//rs/xnet/payload_builder:__subpackages__",
])

rust_library(
    name = "tls_interfaces",
    srcs = glob(["src/**/*.rs"]),
    crate_name = "ic_crypto_tls_interfaces",
    version = "0.9.0",
    deps = [
        # Keep sorted.
        "//rs/protobuf",
        "//rs/types/types",
        "@crate_index//:rustls",
        "@crate_index//:serde",
        "@crate_index//:thiserror",
        "@crate_index//:x509-parser",
    ],
)

rust_test(
    name = "tls_interfaces_test",
    crate = ":tls_interfaces",
    deps = [
        # Keep sorted.
        "//rs/crypto/test_utils/reproducible_rng",
        "//rs/crypto/test_utils/tls",
        "@crate_index//:assert_matches",
        "@crate_index//:json5",
        "@crate_index//:maplit",
    ],
)
